home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / H-I / HintTemplate.cpt / Hint Template / background_2640.txt < prev    next >
Text File  |  1989-02-26  |  10KB  |  434 lines

  1. -- background: 2640 from stack: in
  2. -- bmap block id: 2492
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   Hide Bkgnd Field "Hint 1"
  9.   Hide Bkgnd Field "Hint 2"
  10.   Hide Bkgnd Field "Hint 3"
  11.   Hide Bkgnd Field "Hint 4"
  12.  
  13.   Put Bkgnd Field "Is Open" into it
  14.   If it then send mouseUp to Bkgnd Button "Close Hints"
  15. end closeCard
  16.  
  17. on openCard
  18.   Put Bkgnd Field "Last Shown" into theLast
  19.   if theLast is empty then put 0 into theLast
  20.   Repeat with it = 1 to theLast
  21.     put "Hint " & it into theField
  22.     show Bkgnd Field theField
  23.   end Repeat
  24. end openCard
  25.  
  26.  
  27.  
  28. -- part 1 (button)
  29. -- low flags: 00
  30. -- high flags: 8003
  31. -- rect: left=10 top=321 right=340 bottom=69
  32. -- title width / last selected line: 0
  33. -- icon id / first selected line: 0 / 0
  34. -- text alignment: 1
  35. -- font id: 0
  36. -- text size: 12
  37. -- style flags: 0
  38. -- line height: 16
  39. -- part name: Import
  40. ----- HyperTalk script -----
  41. on mouseUp
  42.   Push Card
  43.  
  44.   Put FileName("TEXT") into theFile
  45.   if theFile is not empty then
  46.     go to last card
  47.     open file theFile
  48.     read from file theFile until return
  49.     repeat while it is not empty
  50.       if word 1 to 3 of it <> "** Card **" then
  51.         read from file theFile until return
  52.         next repeat
  53.       else
  54.         read from file theFile until return
  55.       end if
  56.  
  57.       DoMenu New Card
  58.  
  59.       Delete Char Offset(Return,it) of it
  60.       Put it into Bkgnd Field "Problem Description"
  61.  
  62.       Hide Bkgnd Field "Hint 1"
  63.       Hide Bkgnd Field "Hint 2"
  64.       Hide Bkgnd Field "Hint 3"
  65.       Hide Bkgnd Field "Hint 4"
  66.  
  67.       put empty into Bkgnd Field "Hint 1"
  68.       put empty into Bkgnd Field "Hint 2"
  69.       put empty into Bkgnd Field "Hint 3"
  70.       put empty into Bkgnd Field "Hint 4"
  71.  
  72.       Put 0 into Bkgnd Field "Last Shown"
  73.       Put false into Bkgnd Field "Is Open"
  74.  
  75.       read from file theFile until return
  76.       if word 1 to 3 of it = "** Card **" then
  77.         next repeat
  78.       end if
  79.  
  80.       Delete Char Offset(Return,it) of it
  81.       if it = "" then put empty into Bkgnd Field "Hint 1"
  82.       else Put it into Bkgnd Field "Hint 1"
  83.  
  84.       read from file theFile until return
  85.       if word 1 to 3 of it = "** Card **" then
  86.         next repeat
  87.       end if
  88.  
  89.       Delete Char Offset(Return,it) of it
  90.       if it = "" then put empty into Bkgnd Field "Hint 2"
  91.       else Put it into Bkgnd Field "Hint 2"
  92.  
  93.       read from file theFile until return
  94.       if word 1 to 3 of it = "** Card **" then
  95.         next repeat
  96.       end if
  97.  
  98.       Delete Char Offset(Return,it) of it
  99.       if it = "" then put empty into Bkgnd Field "Hint 3"
  100.       else Put it into Bkgnd Field "Hint 3"
  101.  
  102.       read from file theFile until return
  103.       if word 1 to 3 of it = "** Card **" then
  104.         next repeat
  105.       end if
  106.  
  107.       Delete Char Offset(Return,it) of it
  108.       if it = "" then put empty into Bkgnd Field "Hint 4"
  109.       else Put it into Bkgnd Field "Hint 4"
  110.  
  111.       read from file theFile until return
  112.     end repeat
  113.     close file theFile
  114.   end if
  115.   Pop Card
  116. end mouseUp
  117.  
  118.  
  119.  
  120. -- part 2 (button)
  121. -- low flags: 00
  122. -- high flags: 8003
  123. -- rect: left=218 top=321 right=338 bottom=279
  124. -- title width / last selected line: 0
  125. -- icon id / first selected line: 0 / 0
  126. -- text alignment: 1
  127. -- font id: 0
  128. -- text size: 12
  129. -- style flags: 0
  130. -- line height: 16
  131. -- part name: Find
  132. ----- HyperTalk script -----
  133. on mouseUp
  134.   global FindText
  135.  
  136.   Ask "What do you wish a hint on?" with FindText
  137.   go to next card of this background
  138.   Find Chars it in field "Problem Description"
  139.   if the Result = "not found" then
  140.     answer "No hints were found for" && it with "OK"
  141.   end if
  142.  
  143.   put it into FindText
  144. end mouseUp
  145.  
  146.  
  147.  
  148. -- part 3 (button)
  149. -- low flags: 00
  150. -- high flags: 0000
  151. -- rect: left=184 top=319 right=340 bottom=208
  152. -- title width / last selected line: 0
  153. -- icon id / first selected line: 1014 / 1014
  154. -- text alignment: 1
  155. -- font id: 0
  156. -- text size: 12
  157. -- style flags: 0
  158. -- line height: 16
  159. -- part name: Previous
  160. ----- HyperTalk script -----
  161. on mouseUp
  162.   go to previous card of this background
  163. end mouseUp
  164.  
  165.  
  166.  
  167. -- part 4 (button)
  168. -- low flags: 00
  169. -- high flags: 0000
  170. -- rect: left=286 top=319 right=340 bottom=310
  171. -- title width / last selected line: 0
  172. -- icon id / first selected line: 1013 / 1013
  173. -- text alignment: 1
  174. -- font id: 0
  175. -- text size: 12
  176. -- style flags: 0
  177. -- line height: 16
  178. -- part name: Next
  179. ----- HyperTalk script -----
  180. on mouseUp
  181.   go to next card of this background
  182. end mouseUp
  183.  
  184.  
  185.  
  186. -- part 6 (button)
  187. -- low flags: 00
  188. -- high flags: 8003
  189. -- rect: left=445 top=321 right=340 bottom=504
  190. -- title width / last selected line: 0
  191. -- icon id / first selected line: 0 / 0
  192. -- text alignment: 1
  193. -- font id: 0
  194. -- text size: 12
  195. -- style flags: 0
  196. -- line height: 16
  197. -- part name: New
  198. ----- HyperTalk script -----
  199. on mouseUp
  200.   Push Card
  201.  
  202.   Go to last card
  203.   DoMenu New Card
  204.  
  205.   Hide Bkgnd Field "Hint 1"
  206.   Hide Bkgnd Field "Hint 2"
  207.   Hide Bkgnd Field "Hint 3"
  208.   Hide Bkgnd Field "Hint 4"
  209.  
  210.   Ask "Enter Problem Description:"
  211.   Put it into Bkgnd Field "Problem Description"
  212.  
  213.   Ask "Enter First Hint:"
  214.   Put it into Bkgnd Field "Hint 1"
  215.  
  216.   Ask "Enter Second Hint:"
  217.   Put it into Bkgnd Field "Hint 2"
  218.  
  219.   Ask "Enter Third Hint:"
  220.   Put it into Bkgnd Field "Hint 3"
  221.  
  222.   Ask "Enter Fourth Hint:"
  223.   Put it into Bkgnd Field "Hint 4"
  224.  
  225.   Put 0 into Bkgnd Field "Last Shown"
  226.   Put false into Bkgnd Field "Is Open"
  227.  
  228.   Pop Card
  229. end mouseUp
  230.  
  231.  
  232.  
  233. -- part 7 (button)
  234. -- low flags: 00
  235. -- high flags: 8003
  236. -- rect: left=212 top=296 right=316 bottom=284
  237. -- title width / last selected line: 0
  238. -- icon id / first selected line: 0 / 0
  239. -- text alignment: 1
  240. -- font id: 0
  241. -- text size: 12
  242. -- style flags: 0
  243. -- line height: 16
  244. -- part name: Take Hint
  245. ----- HyperTalk script -----
  246. on mouseUp
  247.   Put Bkgnd Field "Last Shown" into it
  248.   If it < 4 then
  249.     add 1 to it
  250.     put "Hint " & it into theField
  251.     If Bkgnd Field theField is not empty then
  252.       put it into Bkgnd Field "Last Shown"
  253.       show Bkgnd Field theField
  254.     else
  255.       answer "There are no more hints on this card" with "OK"
  256.     end if
  257.   else
  258.     answer "There are no more hints on this card" with "OK"
  259.   end if
  260. end mouseUp
  261.  
  262.  
  263.  
  264. -- part 8 (field)
  265. -- low flags: 01
  266. -- high flags: 0002
  267. -- rect: left=1 top=38 right=73 bottom=511
  268. -- title width / last selected line: 0
  269. -- icon id / first selected line: 0 / 0
  270. -- text alignment: 0
  271. -- font id: 3
  272. -- text size: 12
  273. -- style flags: 0
  274. -- line height: 16
  275. -- part name: Problem Description
  276.  
  277.  
  278. -- part 9 (field)
  279. -- low flags: 81
  280. -- high flags: 0002
  281. -- rect: left=1 top=93 right=128 bottom=511
  282. -- title width / last selected line: 0
  283. -- icon id / first selected line: 0 / 0
  284. -- text alignment: 0
  285. -- font id: 3
  286. -- text size: 12
  287. -- style flags: 0
  288. -- line height: 16
  289. -- part name: Hint 1
  290.  
  291.  
  292. -- part 10 (field)
  293. -- low flags: 81
  294. -- high flags: 0002
  295. -- rect: left=1 top=148 right=183 bottom=511
  296. -- title width / last selected line: 0
  297. -- icon id / first selected line: 0 / 0
  298. -- text alignment: 0
  299. -- font id: 3
  300. -- text size: 12
  301. -- style flags: 0
  302. -- line height: 16
  303. -- part name: Hint 2
  304.  
  305.  
  306. -- part 11 (field)
  307. -- low flags: 81
  308. -- high flags: 0002
  309. -- rect: left=1 top=203 right=238 bottom=511
  310. -- title width / last selected line: 0
  311. -- icon id / first selected line: 0 / 0
  312. -- text alignment: 0
  313. -- font id: 3
  314. -- text size: 12
  315. -- style flags: 0
  316. -- line height: 16
  317. -- part name: Hint 3
  318.  
  319.  
  320. -- part 12 (field)
  321. -- low flags: 81
  322. -- high flags: 0002
  323. -- rect: left=1 top=258 right=293 bottom=511
  324. -- title width / last selected line: 0
  325. -- icon id / first selected line: 0 / 0
  326. -- text alignment: 0
  327. -- font id: 3
  328. -- text size: 12
  329. -- style flags: 0
  330. -- line height: 16
  331. -- part name: Hint 4
  332.  
  333.  
  334. -- part 13 (field)
  335. -- low flags: 81
  336. -- high flags: 0000
  337. -- rect: left=14 top=25 right=41 bottom=49
  338. -- title width / last selected line: 0
  339. -- icon id / first selected line: 0 / 0
  340. -- text alignment: 0
  341. -- font id: 3
  342. -- text size: 12
  343. -- style flags: 0
  344. -- line height: 16
  345. -- part name: Last Shown
  346.  
  347.  
  348. -- part 18 (button)
  349. -- low flags: 00
  350. -- high flags: 8003
  351. -- rect: left=124 top=296 right=316 bottom=205
  352. -- title width / last selected line: 0
  353. -- icon id / first selected line: 0 / 0
  354. -- text alignment: 1
  355. -- font id: 0
  356. -- text size: 12
  357. -- style flags: 0
  358. -- line height: 16
  359. -- part name: Reset Hints
  360. ----- HyperTalk script -----
  361. on mouseUp
  362.   Hide Bkgnd Field "Hint 1"
  363.   Hide Bkgnd Field "Hint 2"
  364.   Hide Bkgnd Field "Hint 3"
  365.   Hide Bkgnd Field "Hint 4"
  366.  
  367.   Put 0 into Bkgnd Field "Last Shown"
  368. end mouseUp
  369.  
  370.  
  371.  
  372. -- part 19 (button)
  373. -- low flags: 00
  374. -- high flags: 8003
  375. -- rect: left=291 top=296 right=316 bottom=370
  376. -- title width / last selected line: 0
  377. -- icon id / first selected line: 0 / 0
  378. -- text alignment: 1
  379. -- font id: 0
  380. -- text size: 12
  381. -- style flags: 0
  382. -- line height: 16
  383. -- part name: Open Hints
  384. ----- HyperTalk script -----
  385. on mouseUp
  386.   put Bkgnd Field "Is Open" into it
  387.   if not it then
  388.     set name of bkgnd button "Open Hints" to "Close Hints"
  389.     put true into Bkgnd Field "Is Open"
  390.  
  391.     set lockText of Bkgnd Field "Problem Description" to false
  392.     set lockText of Bkgnd Field "Hint 1" to false
  393.     set lockText of Bkgnd Field "Hint 2" to false
  394.     set lockText of Bkgnd Field "Hint 3" to false
  395.     set lockText of Bkgnd Field "Hint 4" to false
  396.  
  397.     Show Bkgnd Field "Hint 1"
  398.     Show Bkgnd Field "Hint 2"
  399.     Show Bkgnd Field "Hint 3"
  400.     Show Bkgnd Field "Hint 4"
  401.   else
  402.     set name of bkgnd button "Close Hints" to "Open Hints"
  403.     put false into Bkgnd Field "Is Open"
  404.  
  405.     set lockText of Bkgnd Field "Problem Description" to true
  406.     set lockText of Bkgnd Field "Hint 1" to true
  407.     set lockText of Bkgnd Field "Hint 2" to true
  408.     set lockText of Bkgnd Field "Hint 3" to true
  409.     set lockText of Bkgnd Field "Hint 4" to true
  410.  
  411.     Hide Bkgnd Field "Hint 1"
  412.     Hide Bkgnd Field "Hint 2"
  413.     Hide Bkgnd Field "Hint 3"
  414.     Hide Bkgnd Field "Hint 4"
  415.  
  416.     Put 0 into Bkgnd Field "Last Shown"
  417.   end if
  418. end mouseUp
  419.  
  420.  
  421.  
  422. -- part 20 (field)
  423. -- low flags: 81
  424. -- high flags: 0000
  425. -- rect: left=119 top=26 right=39 bottom=159
  426. -- title width / last selected line: 0
  427. -- icon id / first selected line: 0 / 0
  428. -- text alignment: 0
  429. -- font id: 3
  430. -- text size: 12
  431. -- style flags: 0
  432. -- line height: 16
  433. -- part name: Is Open
  434.